﻿<UserControl 
    x:Class="RiaCrm.EditRecord.EditRecordView"
    xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"  
    xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="clr-namespace:Acando.Dynamics.CRM.Silverlight.Library.Controls;assembly=Acando.Dynamics.CRM.Silverlight.Library"
    xmlns:Commands="clr-namespace:Microsoft.Practices.Composite.Presentation.Commands;assembly=Microsoft.Practices.Composite.Presentation"
    >
    
    <ScrollViewer HorizontalAlignment="Stretch" 
                  VerticalAlignment="Stretch"                
                  HorizontalScrollBarVisibility="Disabled" >
        <Grid x:Name="formGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
                <Button x:Name="NewButton" 
                        Width="80" 
                        Height="24"
                        Commands:Click.Command="{Binding newCommand}"
                        HorizontalAlignment="Right"
                        Content="New"
                        Margin="0,2,180,4"/>
                <Button x:Name="SaveButton" 
                    Grid.Row="0" 
                    Width="80" Height="24"
                    HorizontalAlignment="Right"
                    Commands:Click.Command="{Binding saveCommand}"
                    Content="Save"
                    Margin="0,2,90,4"
                    IsEnabled="{Binding Path=CurrentItemIsNotNull}"/>
                <Button x:Name="CancelButton" 
                        Grid.Row="0" 
                        Width="80" Height="24"
                        HorizontalAlignment="Right"
                        Content="Cancel"
                        Commands:Click.Command="{Binding cancelCommand}"
                        IsEnabled="{Binding Path=CurrentItemIsNew}"
                        Margin="0,2,0,4"/>
                
                <my:TabControl x:Name="tabAreas" 
                               Grid.Row="1"
                               HorizontalAlignment="Stretch" 
                               VerticalAlignment="Stretch"/>
            
            <local:LoadingPanelControl x:Name="pnlLoading" 
                                       Grid.Row="1"
                                       Visibility="Collapsed"/>
        </Grid>
    </ScrollViewer>
    
    
</UserControl>
